package Demo1;
class Shape{
    public void draw(){
        System.out.println("画一个图形");
    }

}
class Rect extends Shape{
    public void draw(){
        System.out.println("矩形");
    }
}

class Triangle extends Shape{
    @Override
    public void draw() {
        System.out.println("三角形");
    }
}

class  Cycle extends Shape{
    @Override
    public void draw() {
        System.out.println("圆形");
    }
}

public class Test {
    public static void Draw(Shape shape){
        shape.draw();
    }
    public static void main(String[] args) {
        Shape[] shapes = {new Cycle(),new Rect(),new Cycle(),new Triangle()};
        for (Shape shape : shapes){
            shape.draw();
        }
    }
}
